import random

def TaskGenerator(compute_L, compute_R, compute_step,communicate_L, communicate_R, communicate_step, size=20):
    #create task lists
    #return [[task1_compute, task1_communicate], ... ]
    tasks = []
    for i in range(size):
        compute_cost = random.randrange(compute_L, compute_R, compute_step)
        communicate_cost = random.randrange(communicate_L, communicate_R, communicate_step)
        task = [compute_cost, communicate_cost]
        tasks.append(task)
    return tasks

if __name__ == '__main__':
    tasks = TaskGenerator(50e6, 5000e6, 1e6, 100000, 1e6, 10000, 20)
    print(tasks)